; TODO: command register shadow, to prevent race conditions